//
//  DetailViewController.m
//  17-SandBoxHomeWork
//
//  Created by 曹曹 on 16/8/5.
//  Copyright © 2016年 曹曹. All rights reserved.
//

#import "DetailViewController.h"
#import "Contacts.h"

@interface DetailViewController ()
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *phoneLabel;
@property (weak, nonatomic) IBOutlet UILabel *addressLabel;
@property (weak, nonatomic) IBOutlet UIImageView *imageView;
@end

@implementation DetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    _imageView.layer.cornerRadius = self.view.frame.size.width / 6;
    _imageView.layer.masksToBounds = YES;
    [self setValueForControls];
}

- (void)setValueForControls {
    _nameLabel.text = self.contact.contactName;
    _addressLabel.text = self.contact.contactAddress;
    _phoneLabel.text = self.contact.contactPhone;
    _imageView.image = [UIImage imageNamed:self.contact.contactAvatar];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
